package com.ojoin.trade.common.web.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.exception.DaoException;
import com.ojoin.trade.common.web.dao.TbBillDateInfoDao;
import com.ojoin.trade.common.web.domain.TbBillDateInfo;

/**
 * Created with IntelliJ IDEA. User: Administrator Date: 16-4-15 Time: 下午2:24 To
 * change this template use File | Settings | File Templates.
 */
@Repository
public class TbBillDateInfoDaoImpl extends BaseDaoImpl<TbBillDateInfo>
		implements TbBillDateInfoDao {
	@Override
	public TbBillDateInfo queryBillDateByLoanDateAndType(String loandate,
			String busitype) throws BusinessException {
		String methodMap = "queryBillDateByLoanDateAndType";
		Map<String, Object> map = new HashMap<>();
		map.put("loandate", loandate);
		map.put("busitype", busitype);
		try {
			TbBillDateInfo vo = this.sqlSessionTemplate.selectOne(methodMap,
					map);
			return vo;
		} catch (Exception e) {
			throw new DaoException(String.format("查询放款日对应的交易明细日期出错！语句：%s",
					getSqlName(methodMap)), e);
		}

	}

}
